home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 19 / Mac Magazin and MacEasy Magazine CD - Issue 19.iso / Grafik & Text & Film / Quark XTensions / Freeware Xtensions / XPress Scripts 1.0 / Item guides / Item guides next >
Text File  |  1994-08-10  |  2KB  |  46 lines

  1.     tell application "QuarkXPress 3.3"
  2.         activate
  3.         if document 1 exists then
  4.             copy tool mode of document 1 to toolMode
  5.             set tool mode of document 1 to drag mode
  6.             copy selection of document 1 to x
  7.             tell current page of document 1
  8.                 set page rule origin of document 1 to {0, 0}
  9.                 copy (count of (generic boxes whose selected is true)) to numSelected
  10.                 if numSelected = 0 then
  11.                     beep
  12.                     display dialog "Check a box is selected and" & return & "that it is on the current page." buttons "OK" default button 1 with icon 1
  13.                     do updates
  14.                 else if numSelected is not 1 then
  15.                     beep
  16.                     display dialog "" & numSelected & " items have been selected." & return & "(Only one box can be used at a time)." buttons "OK" default button 1 with icon 2
  17.                     do updates
  18.                 else if (box type of generic boxes whose selected is true) = line box then
  19.                     beep
  20.                     display dialog "Cannot use lines." buttons "OK" default button 1 with icon 2
  21.                     do updates
  22.                 else
  23.                     copy bounds of x as list to boxBounds
  24.                     copy item 1 of boxBounds as real to bounds1
  25.                     copy item 2 of boxBounds as real to bounds2
  26.                     copy item 3 of boxBounds as real to bounds3
  27.                     copy item 4 of boxBounds as real to bounds4
  28.                     
  29.                     copy (display dialog "Set guides to selected box:" with icon 2000) to x
  30.                     do updates
  31.                     if button returned of x is "OK" then
  32.                         make horizontal guide at beginning with properties {position:bounds1}
  33.                         make horizontal guide at beginning with properties {position:bounds3}
  34.                         make vertical guide at beginning with properties {position:bounds2}
  35.                         make vertical guide at beginning with properties {position:bounds4}
  36.                     end if
  37.                 end if
  38.             end tell
  39.             set tool mode of document 1 to toolMode
  40.         else
  41.             beep
  42.             display dialog "This script requires an" & return & "open QuarkXPress document." buttons "OK" default button 1 with icon 1
  43.             do updates
  44.         end if
  45.     end tell
  46.